<?php /*Added by suwondo */ ?>
<?php include ('../../connections/con_gl.php'); ?>
<?php
$q = strtolower($_GET["q"]);
if (!$q) return;

mysql_select_db($database_con_gl, $con_gl);

if($_GET['barang'] == 'false'){
$query = mysql_query("select a.id, a.tipekendaraan, b.tahun, b.nopolisi from gl_tipekendaraan as a inner join gl_masterkendaraan as b on (a.id = b.tipekendaraan) where b.tersedia='1' AND b.nopolisi like '%$q%' order by a.tipekendaraan asc") or die (mysql_error());
}else{
$query = mysql_query("select a.id, a.tipekendaraan, b. tahun, b.nopolisi from gl_tipekendaraan as a inner join gl_masterkendaraan as b on (a.id = b.tipekendaraan) inner join gl_jenbar as c on (a.id = c.jenis) where c.barang='$_GET[barang]' AND b.tersedia='1' AND b.nopolisi like '%$q%' order by a.tipekendaraan asc") or die (mysql_error());
}
while(list($id, $tipe, $tahun, $nopol) = mysql_fetch_row($query)){
	echo "$tipe, $tahun - $nopol \n";
}
?>